import { $post, $$get } from '@/utils/request';
import {
  searchByPageParam,
  searchMsAoMachInfoParam,
  insertMsMatchInfoParam,
  searchOperatePageParam,
  changeTaskToMsConsoleParam,
  searchChangedAoParam,
  searchAoMaterialParam,
  taskOutParam,
  searchToolMaterialParam,
  sortStoreRoomOutParam,
  detailedAoInfoParam,
  searchSortedParam,
  searchMatchingParam,
  searchReceiveParam,
  queryPalletTaskParam,
  querySortConsoleParam,
  queryPackageByConsoleParam,
  queryAoByConsoleParam,
  queryMatchInfoByConsoleParam,
  queryPackageTaskParam,
  querySortMaterialParam,
  searchMsTaskAoParam,
  searchMsAoMatchBillParam,
  PackageListQueryParam,
} from './types';

// 配套任务查询，故障改派-弹框查询
export function searchByPage(data: searchByPageParam) {
  return $post('/msTaskPackage/searchByPage', data);
}

// 分拣预配套任务查询
export function searchMsAoMachInfo(data: searchMsAoMachInfoParam) {
  return $post('/MsAoMachInfo/searchByPage', data);
}

// 分拣预配套任务中间表查询
export function searchMsTaskAo(data: searchMsTaskAoParam) {
  return $post('/MsTaskAo/searchByPage', data);
}

// 分拣预配套任务最底层表查询
export function searchMsAoMatchBill(data: searchMsAoMatchBillParam) {
  return $post('/MsAoMatchBill/searchMsAoMatchBill', data);
}

// 分拣预配套上方的数据查询
export function searchTaskCount(data: any) {
  return $post('/msTaskPackage/searchTaskCount', data);
}

// 分拣预配套上方的虚拟配套计算
export function smSpmCallBle(data: any) {
  return $post('/AoMatchPlan/AoMatchPlanExecute', data);
}

// 分拣预配套新增数据查询
export function insertMsMatchInfo(data: insertMsMatchInfoParam) {
  return $post('/MsAoMachInfo/insertMsMatchInfo', data);
}

// 分拣操作查询
export function cacheList(data: any) {
  return $post('/packageUnpackRest/cacheList', data);
}

// 分拣操作-执行任务
export function callSortBox(data: any) {
  return $post('/msTaskPackage/callSortBox', data);
}

// 分拣操作-清理等待任务
export function cleanWaitingTask(data: any) {
  return $post('/SortingPackageTask/cleanWaitingTask', data);
}

// 分拣操作-查看缓存箱
export function viewWorkBin(data: any) {
  return $post('/SortingPackageTask/viewWorkBin', data);
}

// 故障改派-工作包分拣任务列表
export function searchOperatePage(data: searchOperatePageParam) {
  return $post('/msTaskPackage/searchOperatePage', data);
}

// 故障改派-弹框保存
export function changeTaskToMsConsole(data: changeTaskToMsConsoleParam) {
  return $post('/MsConsoleRest/changeTaskToMsConsole', data);
}

// 故障改派-弹框里的下拉框数据
export function selectMsName(data: any) {
  return $post('/MsConsoleRest/selectMsConsloeName', data);
}

// 工艺更改分拣-查询
export function searchChangedAo(data: searchChangedAoParam) {
  return $post('/MsTaskAo/searchChangedAo', data);
}

// 工艺更改分拣-AO物料配送清单
export function searchAoMaterial(data: searchAoMaterialParam) {
  return $post('/MsAoMachInfo/searchByPage', data);
}

// 工艺更改分拣-工作包出库
export function taskOut(data: taskOutParam) {
  return $post('/msTaskPackage/taskOut', data);
}

// 工艺更改分拣-工作包扫码
export function searchToolMaterial(data: searchToolMaterialParam) {
  return $post('/materialReceipt/searchToolMaterial', data);
}

// 工艺更改分拣-缓存箱出库
export function sortStoreRoomOut(data: sortStoreRoomOutParam) {
  return $post('/outStoreroom/sortStoreRoomOut', data);
}

// 工艺更改分拣-缓存箱扫码
export function searchInventoryMaterial(data: searchToolMaterialParam) {
  return $post('/materialReceipt/searchInventoryMaterial', data);
}

// 工作包拆包(工艺更改)-查询
export function detailedAoInfo(data: detailedAoInfoParam) {
  return $post('/msTaskPackage/detailedAoInfo', data);
}

// 工作包取消-查询
export function searchSorted(data: searchSortedParam) {
  return $post('/msTaskPackage/searchSorted', data);
}

// AO替换-架次更改
export function aoStartPlaneNo(data: any) {
  return $post('/replacementAoSortiesRest/aoStartPlaneNo', data);
}

// AO替换-查询
export function searchMatching(data: searchMatchingParam) {
  return $post('/replacementAoSortiesRest/searchMatching', data);
}

// 接收分拣-查询
export function searchReceive(data: searchReceiveParam) {
  return $post('/WmsDeliverPlan/searchByPage', data);
}

// 工作包分拣-查询
export function queryPalletTask(data: any) {
  return $post('/PointPackageSortRest/queryPalletTask', data);
}

export function AOSortingTaskPage(data: any) {
  return $post('/SortingPackageTask/AOSortingTaskPage', data);
}

// 工作包分拣-执行任务
export function PackagePerformTask(data: any) {
  return $post('/SortingPackageTask/PackagePerformTask', data);
}

// 工作包分拣-查看缓存箱
export function materialDistribution(data: any) {
  return $post('/SortingPackageTask/materialDistribution', data);
}

// 工作包分拣-绑定托盘箱子
export function bindingWorkBin(data: any) {
  return $post('/SortingPackageTask/bindingWorkBin', data);
}

// 工作包分拣-查看工作包规则
export function getPackCode(data: any) {
  return $post('/SortingPackageTask/getPackCode', data);
}

// 工作包分拣-缓存箱扫码接口
export function scanConfirmMaterialList(data: any) {
  return $post('/SortingPackageTask/scanConfirmMaterialList', data);
}

// 工作包分拣-保存备注接口
export function saveRemark(data: any) {
  return $post('/SortingPackageTask/SortingSaveRemark', data);
}

// 工作包分拣-保存接口
export function putToolPackage(data: any) {
  return $post('/materialReceipt/putToolPackage', data);
}

// 工作包分拣-查询缓存箱信息
export function queryCanReplaceWorkbin(data: any) {
  return $post('/PointPackageSortRest/queryCanReplaceWorkbin', data);
}
// 工作包分拣-托盘回库
export function taskIn(data: any) {
  return $post('/msTaskPackage/taskIn', data);
}

// 工作包分拣-缓存箱回库
export function sortStoreRoomIn(data: any) {
  return $post('/inStoreroom/sortStoreRoomIn', data);
}

// 工作包分拣-查询托盘下物料
export function selectMaterial(data: any) {
  return $post('/MsAoMachInfo/selectMaterial', data);
}

// 工作包分拣-查询托盘
export function getToolCode(data: any) {
  return $post('/SortingPackageTask/getToolCode', data);
}

// 工作包分拣-更改托盘
export function replaceToolCode(data: any) {
  return $post('/SortingPackageTask/replaceToolCode', data);
}

// 工作包分拣-手动更改托盘
export function replaceToolCodeByHand(data: any) {
  return $post('/SortingPackageTask/replaceToolCodeByHand', data);
}

// 工作包分拣-叫箱
export function insertHcx(data: any) {
  return $post('/PointPackageSortRest/addHcx', data);
}

// 工作包分拣-物料信息
export function getMaterial(data: any) {
  return $post('/SortingPackageTask/getMaterial', data);
}

// 查看缓存箱，相同图号的物料
export function queryWorkbinMaterial(data: any) {
  return $post('/PointPackageSortRest/queryWorkbinMaterial', data);
}

// 更改物料
export function replaceMatchInfo(data: any) {
  return $post('/PointPackageSortRest/replaceMatchInfo', data);
}

// 预配套查询-分拣台查询
export function querySortConsole() {
  return $$get('/MsAoMachInfo/querySortConsole');
}

// 预配套查询-工作包查询
export function queryPackageByConsole(data: any) {
  return $post('/MsAoMachInfo/queryPackageByConsole', data);
}

// 预配套查询-AO查询
export function queryAoByConsole(data: queryAoByConsoleParam) {
  return $post('/MsAoMachInfo/queryAoByConsole', data);
}

// 预配套查询-AO查询
export function queryMatchInfoByConsole(data: queryMatchInfoByConsoleParam) {
  return $post('/MsAoMachInfo/queryMatchInfoByConsole', data);
}

// 预配套查询-AO查询
export function queryMatchBillByConsole(data: queryMatchInfoByConsoleParam) {
  return $post('/MsAoMachInfo/queryMatchBillByConsole', data);
}

// 工作包拆包非工艺更改-拆包查询
export function queryPackageTask(data: queryPackageTaskParam) {
  return $post('/packageUnpackRest/queryPackageTask', data);
}

// 工作包拆包非工艺更改-拆包叫箱
export function callUnpackPalletCode(data: any) {
  return $post('/packageUnpackRest/callUnpackPalletCode', data);
}

// 工作包拆包非工艺更改-拆包不叫盘查询
export function querySortMaterial(data: querySortMaterialParam) {
  return $post('/packageUnpackRest/querySortMaterial', data);
}

// 工作包拆包非工艺更改-配送拆包
export function querySendCancelData(data: any) {
  return $post('/packageUnpackRest/querySendCancelData', data);
}

// 工作包拆包非工艺更改-查询缓存箱子，托盘列表
export function queryPalletCodeMaterial(data: any) {
  return $post('/packageUnpackRest/queryPalletCodeMaterial', data);
}

// 工作包拆包非工艺更改-拆包不叫盘，拆包
export function cancelSort(data: any) {
  return $post('/packageUnpackRest/cancelSort', data);
}
// 工作包拆包非工艺更改-保存功能
export function saveUnpackData(data: any) {
  return $post('/packageUnpackRest/saveUnpackData', data);
}

// 工作包拆包非工艺更改-点击行查询
export function queryAoByPackage(data: any) {
  return $post('/packageUnpackRest/queryAoByPackage', data);
}

// 工作包拆包非工艺更改-撤销入库
export function clearAoMatchInfoSendData(data: any) {
  return $post('/packageUnpackRest/clearAoMatchInfoSendData', data);
}

// 工作包拆包非工艺更改-取消占用弹框查询
export function queryAllotment(data: any) {
  return $post('/packageUnpackRest/queryAllotment', data);
}

// 工作包拆包非工艺更改-撤销占用
export function cancelAlloment(data: any) {
  return $post('/packageUnpackRest/cancelAlloment', data);
}

// 工作包拆包非工艺更改-撤销占用
export function cancelOut(data: any) {
  return $post('/packageUnpackRest/cancelOut', data);
}

// 分拣任务查询-AO列表查询
export function queryAo(data: any) {
  return $post('/compackageAoQueryController/queryAOList', data);
}

// 分拣任务查询-物料清单
export function searchAoBillById(data: any) {
  return $post('/compackageAoQueryController/queryMatchInfoList', data);
}

// 分拣任务查询-配套清单
export function searchAoMatchById(data: any) {
  return $post('/compackageAoQueryController/queryAoBillInfoList', data);
}

// 分拣任务查询-查询重新配套信息
export function searchHandleMatchInfo(data: any) {
  return $post('/packageAoQueryRest/searchHandleMatchInfo', data);
}

// 分拣任务查询-保存配套信息
export function handleMatch(data: any) {
  return $post('/packageAoQueryRest/handleMatch', data);
}

// 分拣任务查询-删除配套
export function remmoveMatchInfo(data: any) {
  return $post('/packageAoQueryRest/remmoveMatchInfo', data);
}
// 综合查询-工作包列表查询
export function packageListQuery(data: any) {
  return $post('/compackageAoQueryController/searchPackageList', data);
}

// 综合查询-AO列表查询
export function aoListQuery(data: any) {
  return $post('/compackageAoQueryController/queryPackageAOList', data);
}

// 综合查询-物料清单查询
export function billListQuery(data: any) {
  return $post('/compackageAoQueryController/queryPackageAoMatch', data);
}

// 综合查询-配套清单查询
export function matchListQuery(data: any) {
  return $post('/compackageAoQueryController/queryPackageAoFacili', data);
}

// 新分拣操作
// 开始作业
export function startSortingTask(data: any) {
  return $post('/SortingPackageTask/startSortingTask', data);
}
// 暂停作业
export function pauseSortingTask(data: any) {
  return $post('/SortingPackageTask/pauseSortingTask', data);
}
// 查看队列
export function getWorkBinAndTool(data: any) {
  return $post('/SortingPackageTask/getWorkBinAndTool', data);
}

// 计划管理-分拣台任务查询
export function queryProgramManagCount(data: any) {
  return $post('/compackageAoQueryController/queryProgramManagCount', data);
}
